@namespace AntDesign.Pro.Layout
@inherits AntDomComponentBase

<TabPane Key="@TabKey">
    <Tab>@Title (@(Data?.Count ?? 0))</Tab>
    <ChildContent>
        @if (Data == null || Data.Count <= 0)
        {
            <div class="notFound" style="min-width: 336px;">
                <img
                    src="https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg"
                    alt="not found"
                />
                <div>@EmptyText</div>
            </div>
        }
        else
        {
            <div style="min-width: 336px;">
                <AntList TItem="NoticeIconData"
                         Class="list" 
                         DataSource="@Data"
                         ItemLayout="ListItemLayout.Horizontal">
                    <ListItem>
                        <!--todo: Description shoud be RenderFragment-->
                        @if (string.IsNullOrEmpty(context.Avatar))
                        {
                            <ListItemMeta Avatar="" Description="@context.Description" Class="item">
                                <TitleTemplate>
                                    <div class="title">
                                        @context.Title
                                        <div class="extra">@context.Extra</div>
                                    </div>
                                </TitleTemplate>
                            </ListItemMeta>
                        }
                        else
                        {
                            <ListItemMeta Description="@context.Description" Class="item">
                                <AvatarTemplate>
                                    <Avatar Class="avatar" Src="@context.Avatar" />
                                </AvatarTemplate>
                                <TitleTemplate>
                                    <div class="title">
                                        @context.Title
                                        <div class="extra">@context.Extra</div>
                                    </div>
                                </TitleTemplate>
                            </ListItemMeta>
                        }
                    </ListItem>
                </AntList>
                <div class="bottomBar">
                    @if (ShowClear)
                    {
                        <div @onclick="HandleClear">
                            @ClearText @Title
                        </div>
                    }
    
                    @if (ShowViewMore)
                    {
                        <div @onclick="HandleViewMore">
                            @ViewMoreText
                        </div>
                    }
                </div>
            </div>
        }
    </ChildContent>
</TabPane>
